﻿using System;
using System.Windows.Forms;
using SharpGL;
using System.IO;
using System.Collections;

namespace MutsiEngine
{
    /// <summary>
    /// The main form class.
    /// </summary>
    ///
    public class RenderWindow : Form
    {
        private SharpGL.OpenGLControl openGLControl;
        public SharpGL.OpenGL Gl
        {
            get { return openGLControl.OpenGL; }
        }

        public RenderWindow()
        {
            InitializeComponent();
        }

        public void SetResolution(int width,int height)
        {
            this.openGLControl.Size = new System.Drawing.Size(width, height);
            this.ClientSize = new System.Drawing.Size(width, height);
        }

        public void SetIcon(System.Drawing.Icon icon)
        {
            this.Icon = icon;
        }

        /// <summary>
        /// Design code
        /// </summary>
        private void InitializeComponent()
        {
            this.openGLControl = new SharpGL.OpenGLControl();
            ((System.ComponentModel.ISupportInitialize)(this.openGLControl)).BeginInit();
            this.SuspendLayout();

            //openGLControl
            openGLControl.Name = "openGLControl";
            openGLControl.DrawFPS = true;
            openGLControl.Location = new System.Drawing.Point(0, 0);
            openGLControl.RenderContextType = SharpGL.RenderContextType.FBO;
            openGLControl.Size = new System.Drawing.Size(640, 480);

            //RenderWindow
            this.Name = "RenderWindow";
            this.Text = "Mutsi Engine Render Window";
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.ClientSize = new System.Drawing.Size(640, 480);
            this.Controls.Add(this.openGLControl);
            ((System.ComponentModel.ISupportInitialize)(this.openGLControl)).EndInit();
            this.ResumeLayout(false);
        }
    }
}
